//
//  LYConfig.h
//  LYProfiles
//
//  Created by boom on 2017/6/8.
//  Copyright © 2017年 boomLi. All rights reserved.
//

#ifndef LYConfig_h
#define LYConfig_h

/**系统有关的宏定义*/


/**系统常量*/


/**获取系统对象*/
#define LY_APPLICATION [UIApplication sharedApplication]

#define LY_WINDOW [UIApplication sharedApplication].keyWindow

#define LY_APPDELEGATE [AppDelegate shareAppDelegate]

#define LY_ROOTVIEWCONTROLLER [UIApplication sharedApplication].delegate.window.rootViewController

#define LY_USERDEFAULTS [NSUserDefaults standardUserDefaults]

#define LY_NOTIFICATIONCENTER [NSNotificationCenter defaultCenter]


/**屏幕相关*/
#define LY_CONTROLLER_WIDTH self.view.frame.size.width

#define LY_CONTROLLER_HEIGHT self.view.frame.size.height

#define LY_BOUNDS_WIDTH [[UIScreen mainScreen] bounds].size.width

#define LY_BOUNDS_HEIGHT [[UIScreen mainScreen] bounds].size.height

#define IPHONE6_SCALE_WIDTH KScreenWidth/375.0

#define IPHONE6_SCALE_HEIGHT KScreenHeight/667.0

//根据ip6的屏幕来拉伸
#define LY_REALVALUE_HEIGHT(height) ((height)*(LY_BOUNDS_HEIGHT/667.0f))

#define LY_REALVALUE_WIDTH(width) ((width)*(LY_BOUNDS_WIDTH/375.0f))


/**强弱引用*/
#define LY_WEAKSELF(type) __weak typeof(type)weak##type = type;

#define LY_STRONGSELF(type) __strong typeof(type)type = weak##type;


/**View圆角和加边框*/
#define ViewBorderRadius(View,Radius,Width,Color) \
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]


/**View圆角*/
#define ViewRadius(View,Radius) \
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES]

/**property属性快速声明*/
#define PROPERTY_STRING(s) @property(nonatomic,copy) NSString * s

#define PROPERTY_NSINTEGER(s) @property(nonatomic,assign)NSInteger s

#define PROPERTY_FLOAT(s) @property(nonatomic,assign) float s

#define PROPERTY_NSDICTIONARY(s) @property(nonatomic,strong) NSDictionary * s

#define PROPERTY_NSARRAY(s) @property(nonatomic,strong) NSArray * s

#define PROPERTY_NSMUTABLEARRAY(s) @property(nonatomic,strong) NSMutableArray * s


/**DEBUG模式下打印日志,当前行*/
#ifdef DEBUG

#define LYLOG(fmt,...)NSLog((@"%s[Line %d]" fmt),__PRETTY_FUNCTION__,__LINE__,##__VA_ARGS__);

#else

#define LYLOG(...)

#endif


/**当前设备的判断*/
#define ISIPHONE4S  FTNBoundsH < 568.0
#define ISIPHONE5S  FTNBoundsH == 568.0
#define ISIPHONE6S  FTNBoundsH == 667.0
#define ISIPHONE6SP FTNBoundsH == 736.0


/**颜色*/
#define LYCOLORA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]

#define LYCOLOR(r, g, b) FTNColorA((r), (g), (b), 255)

#define LYRANDOMCOLOR LYCOLOR(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))



/**字体*/
#define BOLDSYSTEMFONT(FONTSIZE) [UIFont boldSystemFontOfSize:FONTSIZE]

#define SYSTEMFONT(FONTSIZE) [UIFont systemFontOfSize:FONTSIZE]

#define FONT(NAME,FONTSIZE) [UIFont fontWithName:(NAME)size:(FONTSIZE)]


/**定义UIImage对象*/
#define ImageWithFile(_pointer)[UIImage imageWithContentsOfFile:([[NSBundle mainBundle]pathForResource:[NSString stringWithFormat:@"%@@%dx",_pointer,(int)[UIScreen mainScreen].nativeScale]ofType:@"png"])]

#define IMAGE_NAMED(name) [UIImage imageNamed:name]


/**设备App相关*/
// app名称
#define APP_NAME [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]
// app版本
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
// app build版本
#define APP_BUILD [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
//手机序列号
#define IDENTIFERNNUMBER [[UIDevice currentDevice] uniqueIdentifier]
//手机别名： 用户定义的名称
#define USERPHONENAME [[UIDevice currentDevice] name]
//设备名称
#define DEVICENAME [[UIDevice currentDevice] systemName]
//手机系统版本
#define PHONEVERSION [[UIDevice currentDevice] systemVersion]
//手机型号
#define PHONEMODEL [[UIDevice currentDevice] model]
//地方型号  （国际化区域名称）
#define LOCALPHONEMODEL [[UIDevice currentDevice] localizedModel]

































#endif /* LYConfig_h */
